import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
/* 客服分类 */
const url = "/back/customer-service-category";
/* 获取 客服分类信息 */
export const getCustomerServiceCategoryInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};
/* 新增，修改客服分类信息 */
export const commonCustomerServiceCategoryInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 修改客服分类 排序 信息 */
export const putCustomerServiceCategorySortInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-sort", params, "PUT");
};
/* 删除 客服分类信息 */
export const deleteCustomerServiceCategoryInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
